<?php

class indexModel extends commonModel {

    public function __construct() {
        $this->initialDB();
    }

    //获取xd_log的所有标题名称（page）
    public function getLogPage() {
        //$table="xd_log";
        $sql = " SELECT * FROM `logdata` WHERE `isdeleted` = 0 GROUP BY `page` order by CONVERT(`page` USING utf8) DESC";
        //echo $sql;
        $this->db->setStatement($sql);
        $result= $this->db->execute();
        $result=$this->getArray($result);
        //var_dump($result);
        //die;
        return $result;

    }



    public function getStatusTotal($status) {
        //$table="xd_log";
        $sql = " SELECT count(id) as count FROM `orders` WHERE `isdeleted` = 0  AND status=".$status;
        //echo $sql;
        $this->db->setStatement($sql);
        $result= $this->db->execute();
        $result=$this->getArray($result,'one');
        $count=0;
        if (!empty($result)){
            $count=$result['count'];
        }
        return $count;

    }



}
